/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-05-09 15:16:38
 * @LastEditTime : 2023-08-14 08:38:27
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Pages\Front\Assets\Template\BeamSchedule.jsx
 * @Description  :
 */
import './Scss/BeamSchedule.scss'
import { useRequest } from 'ahooks'
import { Http } from '../../../../Common/Api'
import { useState } from 'react'
import { TitleSmall001 } from '../Common/SmallTitle'
import { TextList001 } from '../Common/TextList'

export const BeamSchedule001 = ({ NavEvent }) => {
    NavEvent.useSubscription(val => {
        GetOne({ url: `getConstructionBridgeProgress`, data: { organizationUuid: val.organizationUuid } })
        GetTwo({ url: `getConstructionBeamTypeProgress`, data: { organizationUuid: val.organizationUuid } })
    })
    const { run: GetOne } = useRequest(Http, { manual: true, onSuccess: res => setDataOne(res) })
    const { run: GetTwo } = useRequest(Http, { manual: true, onSuccess: res => setDataTwo(res) })
    const TopOne = [
        { uuid: 1, label: '名称', value: 'bridgeName', flex: 110 },
        { uuid: 2, label: '总数', value: 'totalNum', flex: 73 },
        { uuid: 3, label: '完成', value: 'completeNum', flex: 73 },
        { uuid: 4, label: '百分比', value: 'percent', flex: 96, unit: '%' },
    ]
    const TopTwo = [
        { uuid: 1, label: '名称', value: 'tableName', flex: 110 },
        { uuid: 2, label: '总数', value: 'totalNum', flex: 73 },
        { uuid: 3, label: '完成', value: 'completeNum', flex: 73 },
        { uuid: 4, label: '百分比', value: 'percent', flex: 96, unit: '%' },
    ]
    const [DataOne, setDataOne] = useState()
    const [DataTwo, setDataTwo] = useState()
    return (
        <div className="BeamSchedule001">
            <TitleSmall001 title="粱片需求" />
            {DataOne && <TextList001 Top={TopOne} data={DataOne} />}
            <TitleSmall001 title="粱片种类" />
            {DataTwo && <TextList001 Top={TopTwo} data={DataTwo} />}
        </div>
    )
}
